Caelan Booker
aka Lich (discord - operation404#8123)

First off, this program could be better. I wrote it in an hour, so I KNOW that it could be better. 

This program takes TSV files from http://donjon.bin.sh dungeon generators, and creates SVG data for the 5etools roll20 script "SVG Draw" tool. It reads the whole map file, and sorts each tile into one of two things: a floor tile and a wall tile. Doors, floors, archways; anything that players can walk in is considered a floor tile. Secret doors and walls are considered a wall tile.

The program checks every floor tile and looks at the tile to the top, left, bottom, and right of it. If that tile is a wall tile, the program adds an SVG line saying to draw a path to whichever sides of the floor tile it found a wall on.

This program probably has horrible performance on roll20 because each tile has INDIVIDUAL lines drawn around it, so one big hallway will have like 20 small lines instead of one long one for the dynamic lighting. Beware!

This program doesn't work with caves or isometric very well (It only draws straight grid patterns so it will be ugly looking, if it works at all.)

You need Java to run this program. 

Usage:
1. Go to http://donjon.bin.sh and generate a dungeon map
2. Download the TSV Map
3. Place the TSV Map txt file in the same directory as this program, and rename it "map.txt"
4. Run the program. The output will be something like "mapout65x65.txt"

The output file has all the SVG data you need for your dynamic lighting. Just copy and paste it into the 5etools script SVG Draw tool and run it. 

The filename has the size of the map in width by height, as determined by the TSV map file. This might be slightly bigger than the png image you download from there if there are halls going out of the side of the map, but the shape should be correct so you just have to line the map image up with the dynamic lighting lines.

Let me know if it doesn't work, I wouldn't be surprised. 

(I included a sample TSV file from donjon as well as the map image it represents, for those who might want to test it. Just follow the usage directions and you should get the output file.)




